<?php
	echo CHtml::cssFile(Yii::app()->baseUrl.'/assets/css/home.css');
?>

<div style="height:10px;"></div>

<div class="home_left">
	<?php
		
	?>
</div><!-- end home_left -->

<div class="home_right">
	<div class="thong_ke">
    
	<div id="accordion">
        <h3>Online</h3>
        <div style="padding:0px">
             <table cellpadding="3" cellspacing="0" width="100%">
                <thead>
                    <th width="30">#</th>
                    <th>Thành viên</th>
                    <th>Đăng nhập</th>
                    <th>IP</th>
                </thead>
                <tbody> 
                <?php
                    if (! is_null($rows))
                    {
                        $i = 1;
                        foreach($rows as $row)
                        {
                            echo "<tr>";
                                echo "<td align='center'>";
                                    echo $i++;
                                echo "</td>";
                                echo "<td>";
                                    $user = user::model()->findByPk($row->user_id);
                                    if (! is_null($user))
                                    {
										echo $user["username"];
                                    }
                                    else
                                    {
                                        echo "Guest";
                                    }
                                echo "</td>";
                                
                                echo "<td align='center'>";
                                    echo $row->time_online;
                                echo "</td>";
                                
                                echo "<td align='center'>";
                                    echo $row->ip_online;
                                echo "</td>";
                                
                            echo "</tr>";
                        }
                    }
                ?>
                </tbody>
            </table>   
        </div>
  </div><!-- End id accordion -->
  </div> <!-- end thong_ke -->
</div><!-- end home_right -->